import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { LayerFormsComponent } from './layer-forms.component';
import { LayerFormsInfoComponent } from './layer-forms-info/layer-forms-info.component';
import { LayerFormsConfigureComponent } from './layer-forms-configure/layer-forms-configure.component';
import { LayerFormsOtherComponent } from './layer-forms-other/layer-forms-other.component';
import { LayerFormsResultComponent } from './layer-forms-result/layer-forms-result.component';
import { StepGuard } from './step.guard';

const routes: Routes = [
  {
    path: '',
    component: LayerFormsComponent,
    children: [
      {
        path: '',
        redirectTo: 'info',
        pathMatch: 'full'
      },
      {
        path: 'info',
        component: LayerFormsInfoComponent,
        canActivate: [ StepGuard ],
        data: {
          name: '基本信息'
        }
      },
      {
        path: 'configure',
        component: LayerFormsConfigureComponent,
        canActivate: [ StepGuard ],
        data: {
          name: '参数配置'
        }
      },
      {
        path: 'other',
        component: LayerFormsOtherComponent,
        canActivate: [ StepGuard ],
        data: {
          name: '其他'
        }
      },
      {
        path: 'result',
        component: LayerFormsResultComponent,
        canActivate: [ StepGuard ],
        data: {
          name: '完成'
        }
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class LayerFormsRoutingModule { }
